package cn.edu.hbvtc.qms.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/*
 * 课程评价时间（段），由院系管理员自行设置本院系课程评价开始时间和结束时间
 */
@Entity
@Table(name = "eval_period")
public class EvalPeriod implements Serializable {

	private static final long serialVersionUID = 1L;
	private int id;
	private User deptAdmin;// 院系管理员
	private Department dept;// 院系部门
	private String startDate;// 评价开始时间
	private String endDate;// 评价结束时间
	private Term term;// 学期
	private int enabled;// 是否可用，enabled为1表示可用，为0表示不可用

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	@Column
	public String getStartDate() {
		return startDate;
	}

	public void setStartDate(String startDate) {
		this.startDate = startDate;
	}

	@Column
	public String getEndDate() {
		return endDate;
	}

	public void setEndDate(String endDate) {
		this.endDate = endDate;
	}

	@ManyToOne
	@JoinColumn(name = "dept_admin_id")
	public User getDeptAdmin() {
		return deptAdmin;
	}

	public void setDeptAdmin(User deptAdmin) {
		this.deptAdmin = deptAdmin;
	}

	@ManyToOne
	@JoinColumn(name = "dept_id")
	public Department getDept() {
		return dept;
	}

	public void setDept(Department dept) {
		this.dept = dept;
	}

	@ManyToOne
	@JoinColumn(name = "term_id")
	public Term getTerm() {
		return term;
	}

	public void setTerm(Term term) {
		this.term = term;
	}

	@Column
	public int getEnabled() {
		return enabled;
	}

	public void setEnabled(int enabled) {
		this.enabled = enabled;
	}

}
